﻿
function onLoadSuccess(data) {
    var _orderid;
    var _index = -1;
    var _rowspan = 0;
    for (var i = 0; i < data.rows.length; i++) {
        if (_orderid != data.rows[i].FOrderId) {
            //合并；
            if (_rowspan > 1) {
                mergeCell(_index, _rowspan);
            }
            _orderid = data.rows[i].FOrderId;
            _index = i;
            _rowspan = 1;
        } else {
            _rowspan = _rowspan + 1;
        }
       
    }
    if (_rowspan > 1) {
        mergeCell(_index, _rowspan);
    }
}
function mergeCell(_index, _rowspan) {
    $(Grid.list).datagrid('mergeCells', {
        index: _index,
        field: 'ck',
        rowspan: _rowspan
    }).datagrid('mergeCells', {
        index: _index,
        field: 'SupplierName',
        rowspan: _rowspan
    }).datagrid('mergeCells', {
        index: _index,
        field: 'FOrderNo',
        rowspan: _rowspan
    }).datagrid('mergeCells', {
        index: _index,
        field: 'FShrName',
        rowspan: _rowspan
    }).datagrid('mergeCells', {
        index: _index,
        field: 'FShrTel',
        rowspan: _rowspan
    }).datagrid('mergeCells', {
        index: _index,
        field: 'FAddress',
        rowspan: _rowspan
    });
}